import request from "@/request";
import {POST, GET} from '@/constant'

export const uploadImage = data => request({
  url: '/upload/image',
  method: POST,
  data
})

export const uploadNewsApi = data => request({
  url: '/upload/news',
  method: POST,
  data
})

export const getNewsList = (params) => request({
  url: '/news/list',
  method: GET,
  params,
})

export const deleteNews = (data) => {
  return request({
    url: '/delete/news',
    method: POST,
    data,
  })
}
export const uploadPreview = data => request({
  url: '/upload/preview',
  method: POST,
  data,
})
export const updateDetail = data => request({
  url: '/update/detail',
  data,
  method: POST,
})

export const getNewsById = id => request({
  url: '/news/detail/' + id,
  method: GET,
})

export const updateNews = data => request({
  url: '/update/news',
  method: POST,
  data,
})

export const uploadVideoSlice = data => request({
  url: '/upload/video/slice',
  method: POST,
  data,
})

export const uploadVideo = data => request({
  url: '/upload/video',
  method: POST,
  data
})

export const mergeVideo = data => request({
  url: '/merge/video',
  method: POST,
  data,
})

export const clearCache = data => request({
  url: '/clear/cache',
  method: POST,
  data,
})

export const delNewsList = data => request({
  url: '/del/news/list',
  method: POST,
  data,
})

export const getChart = () => request({
  url: '/news/chart',
  method: GET,
})


// 上传图片地址
export const uploadImages = data => request({
  url: '/common/upload',
  method: POST,
  data
})

// 